<?php
namespace Act\Os;
use Lib\Action;
class SetDomain extends Action{
	public function doGet(){
		$dom_id = get('id',0,'absint');
		$user_mod = model('#User','adm_');
		if(empty($dom_id)) redirect(referer());
		$sub_domains = $user_mod->getSubdomain();
		if(empty($sub_domains) || !$user_mod->checkDomainPriv($dom_id,$sub_domains)){
			echo '对不起，你不具备管理当前分站的资格，请<a href="'.referer().'">返回</a>';
			return;
		}
		model('#Subdomain')->setSubdomainCookie($dom_id);
		redirect(get('ref'));
	}
}